﻿using FluentValidation;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace FlumentValidation.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class yzController : ControllerBase
    {
        
        [HttpPost]
        public IActionResult AddUser(AddNewsUserRequest req)
        {
            user u = new user
            {
                username = req.username,
                email=req.email
            };
            return Ok("123");
        }
        // [HttpGet] 验证是不行的。要[httpPost]
        [HttpGet]
        public IActionResult AddUser1(AddNewsUserRequest req)
        {
            user u = new user
            {
                username = req.username,
                email = req.email
            };
            return Ok("这个是不能验证的");
        }
    }
}
